
<script src="<?= base_url(); ?>third_party/ckeditor/ckeditor.js"></script>


<div class="heading-buttons">
	<h3 class="glyphicons no-js comments"><i></i> News Management</h3>
	


</div>
<div class="separator"></div>
<div class="widget widget-2 widget-body-white finances_summary">
	<div class="widget-head">
		<h4 class="heading glyphicons no-js comments"><i></i> News</h4>
	</div>
	<div class="widget-body">
		<div class="row-fluid">
		        <form name="banner" method="POST" action="<?= base_url(); ?>secure/news/news_management/submit_news">
                
                <table class="table table-condensed" >
				
				
                                        
                                       <?php
                                            $this->session->flashdata('message'); {
                                                $msg = $this->session->flashdata('message');
                                                echo '<font color="red">' . $msg . '</font>';
                                            }
                                            ?>
                
				<tbody>
					<tr>
						<td class="left">Title</td>
						<td>
						<input name="title" type ="text" class="span12" ></td>
					</tr>
					<tr>
						<td class="left">Meta Title</td>
						<td>
					<input name="meta_title" type ="text" class="span12"></td>
					</tr>
					<tr>
						<td class="left">Meta Keyword</td>
						<td>
					<input name="meta_keyword" type="text" class="span12"></td>
					</tr>
					<tr>
						<td class="left">Meta Description</td>
						<td>
					    <textarea name="meta_description" class="span12" ></textarea></td>
					</tr>
					<tr>
						<td class="left">Description</td>
						<td>
					  <textarea id="news_details" name="news_detail"></textarea>
                        <script type="text/javascript">
                            CKEDITOR.replace( 'news_details',
                            {
                                skin : 'v2',
                                enterMode : CKEDITOR.ENTER_BR,
                                toolbar :
                                    [
                                    [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
                                    [ 'UIColor' ]
                                ]

                            });
                        </script></tr>
					
					<tr>
						<td class="center"></td>
						<td>
						<input type="submit" class="btn btn-inverse" value="Add News" name="insert_news" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  ></td>
					</tr>
				</tbody>
			</table>
	
     </form>           
            
	</div>
	</div>
</div>


	<div class="widget widget-gray widget-body-white">
		<div class="widget-head">
			<h4 class="heading glyphicons no-js comments"><i></i> News Management</h4>
		</div>
		<div class="widget-body" style="padding: 10px 0;">
			<table class="table table-bordered  table-condensed">
				<thead>
					<tr>
						<th class="left">POSTED ON</th>
						<th>TITLE</th>
						<th>ACTION</th>
					</tr>
				</thead>
				<tbody>
				   <?php foreach ($news['all'] as $news) : ?>
					<tr>
						<td class="left">
						<?= $news->posted_on;?></td>
						<td><?= substr($news->title,0,75);?> </td>
							<td class="right">
						    <a class="btn" href="<?= base_url(); ?>secure/news/news_management/edit_news/<?= $news->id; ?>" onclick="return confirm('Are you sure you want to Edit?')"><i class="icon-edit"></i> </a>
                        <a class="btn" href="<?= base_url(); ?>secure/news/news_management/delete_news/<?= $news->id; ?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');" ><i class="icon-remove"></i></a>
     </td>
					</tr>
					<?php endforeach;?>
							</tbody>
							
			</table>
			<div class="pagination pull-right">
		<ul>
			<li><?php  echo $this->pagination->create_links(); ?>
			</li>
		</ul>
		</div>
		</div>
	</div>

	